package com.zsl.picture.util;


import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author zhangshilin
 * @Date 2022/4/13
 * @Version 1.0
 */
public class HttpUtils {
    public static void main(String[] args) {
        List<String> urlList = new ArrayList<>();
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/6fcd1b07cfac475794f95576aa0e44c2-04741计算机网络原理押题精华_01.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/d007808c27e042308a70349ef5a867cd-04741计算机网络原理押题精华_02.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/3e87a09fd31946f4b9fddb6f952e441c-04741计算机网络原理押题精华_03.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/f3bb81abab7c4625ac362bbdf0138b48-04741计算机网络原理押题精华_04.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/7dde70d7b28e4774a85be3a0ca21f6cd-04741计算机网络原理押题精华_05.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/b0361f48122d4bb9862815f3e1322ee9-04741计算机网络原理押题精华_06.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/bfb2908438e345baabe031a26b791617-04741计算机网络原理押题精华_07.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/606e618b8c1a441e8f6a0172a162c122-04741计算机网络原理押题精华_08.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/1b3fe2f3d6a04e00b16b29d4e44e63e5-04741计算机网络原理押题精华_09.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/4280f66ce57546f08f7a10c95c7e4ae8-04741计算机网络原理押题精华_10.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/c7cbb68dbd0042e5baf5e0167d810c9e-04741计算机网络原理押题精华_11.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/8e4d1016c9ee4ac7a237e6c7ac7f7077-04741计算机网络原理押题精华_12.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/df9a9aa57eba4f5a8ea7b03cf42f0755-04741计算机网络原理押题精华_13.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/dfbc1fcc9fe948e9a90936c84caf550a-04741计算机网络原理押题精华_14.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/3066159119e74040ac6046bbf4c66267-04741计算机网络原理押题精华_15.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/ebed2fb9f57b481fb0153a181dc5b99e-04741计算机网络原理押题精华_16.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/2025048d9c6740f1afa43e501c5d212a-04741计算机网络原理押题精华_17.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/cb555b6a7ebf41fbb785398632190ebc-04741计算机网络原理押题精华_18.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/9733f34d90a44ce7844e6d7160cec83e-04741计算机网络原理押题精华_19.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/3ec170c3a97f424aa31baa6e8bfe9f1c-04741计算机网络原理押题精华_20.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/8a99d6fba3404ab1a3322a998f024eca-04741计算机网络原理押题精华_21.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/223e01f2eeff4444a5c993ff688c319f-04741计算机网络原理押题精华_22.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/4a9524c13ac648be97e5840e6d4f7dee-04741计算机网络原理押题精华_23.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/5c0baa0457ed4f0cb26d435e78f4a896-04741计算机网络原理押题精华_24.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/cdcb9ebea5dd41b6a5c2565a0f779a37-04741计算机网络原理押题精华_25.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/9ede3bce81bb4f75a7e81e75f152e265-04741计算机网络原理押题精华_26.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/5cccaafda82a4b5fb7aa749553ce8459-04741计算机网络原理押题精华_27.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/39971990aa004891bb6b0c6c1b2866eb-04741计算机网络原理押题精华_28.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/495d6184d2304433929f211a42fbebb0-04741计算机网络原理押题精华_29.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/adfe62bba5b14140ba0a7440519ad676-04741计算机网络原理押题精华_30.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/b4441fe0af1845e6ad51536135b8c8c2-04741计算机网络原理押题精华_31.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/a955e5a1fea0427bbe37cf432d0857a0-04741计算机网络原理押题精华_32.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/d3eacf2ded414e7e9cbff42d6509d2ae-04741计算机网络原理押题精华_33.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/0cb1a1f18a154225936e493b1e8d5e49-04741计算机网络原理押题精华_34.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/4f50a521e34a4743913676c618562409-04741计算机网络原理押题精华_35.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/382417ec55a9401b9cd94cdacf002893-04741计算机网络原理押题精华_36.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/143783516ae74c679a2e1672f5bd7611-04741计算机网络原理押题精华_37.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/6d38ad48e87b4e2bb2206a3326afaf83-04741计算机网络原理押题精华_38.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/10eb6f187e744125988b46a81f8110f3-04741计算机网络原理押题精华_39.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/cf963b2b79014961b0f544d095f7026b-04741计算机网络原理押题精华_40.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/064ed28f0fd540818ecbacd055e540a9-04741计算机网络原理押题精华_41.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/35877b02929d4c20bf0802a7c461eda8-04741计算机网络原理押题精华_42.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/67bf4c0136d148e3a7e1e3a9c6ec490c-04741计算机网络原理押题精华_43.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/5047d4d3d1f74e0f98c12269bfdafe1b-04741计算机网络原理押题精华_44.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/a6f17283a6564031b9ee9eaa04272210-04741计算机网络原理押题精华_45.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/c640405e357e436eafa8ec1d44ec76c4-04741计算机网络原理押题精华_46.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/feae3ff05d2f4190b5d184e0ab83111e-04741计算机网络原理押题精华_47.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/a116db00ed184a6ebe23ae07f1f30bfc-04741计算机网络原理押题精华_48.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/5aa5bbe42711402b85686df976a22a73-04741计算机网络原理押题精华_49.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/03416d823c2441719ec571c2c562c758-04741计算机网络原理押题精华_50.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/925d591becc04a208c5d6aaf43fd088f-04741计算机网络原理押题精华_51.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/ba3a4589137e41afbbbdea99eaa263bf-04741计算机网络原理押题精华_52.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/d1ab7d87c66946d094b9bbc2d9e55ea0-04741计算机网络原理押题精华_53.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/92a8b6047a744422b9250cb306f8b5dd-04741计算机网络原理押题精华_54.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/ebbb1e80c0304579819cd53f7fd8b1f4-04741计算机网络原理押题精华_55.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/b9d26e9ebf0d4ba8acb6d65c64029204-04741计算机网络原理押题精华_56.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/ddf76dcef30e4907896024e616e47e96-04741计算机网络原理押题精华_57.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/62d5ee44470a4135921a91cbbd6b7114-04741计算机网络原理押题精华_58.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/b9e292253d564dc88efc5b94705a0286-04741计算机网络原理押题精华_59.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/1580245a02b24b4fa88fa7382ed92e57-04741计算机网络原理押题精华_60.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/766f94da51fe4355877c34573c331bda-04741计算机网络原理押题精华_61.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/5721992002794a898212279ae28c8ddd-04741计算机网络原理押题精华_62.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/ba670f66719046e6977cebd462e022ba-04741计算机网络原理押题精华_63.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/6201193c99a04c22aef57670af192310-04741计算机网络原理押题精华_64.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/d66b8b11679c4a70871a0c9751f3cd15-04741计算机网络原理押题精华_65.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/77bf28b25155449c9e23641d001e1fcd-04741计算机网络原理押题精华_66.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/c8050186bc7e40f08127ee6fac770f7b-04741计算机网络原理押题精华_67.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/a6658a3da22c4c4e91e3f8ffe6896451-04741计算机网络原理押题精华_68.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/c38e3ea4c5d849be9e05a0cdb5f0a467-04741计算机网络原理押题精华_69.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/7610f26f05e64bbcbbeadaee6801dc10-04741计算机网络原理押题精华_70.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/0382756b9b8f4f3b924cc90d248b45c2-04741计算机网络原理押题精华_71.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/7042a52b19ca4459a6b1bc4aadd9748b-04741计算机网络原理押题精华_72.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/e48f356e9d2949c6990c293f80a803de-04741计算机网络原理押题精华_73.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/3c04a4ec6f204392a7ba2b619fc3495a-04741计算机网络原理押题精华_74.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/41d2fb3bb72d4fabb033542edbe3e1dc-04741计算机网络原理押题精华_75.PNG");
        urlList.add("https://zktree-product.oss-cn-huhehaote.aliyuncs.com/courseImage/2022-01-14/6f6a05aeb5ac49cdaa26bb9f4ea32f74-04741计算机网络原理押题精华_76.PNG");

        for (int i=0;i<=urlList.size();i++) {
            HttpResponse httpResponse = HttpRequest.get(urlList.get(i)).execute();
            String[] name = urlList.get(i).split("/");
            String fileName = name[name.length-1].split("04741")[1];
            File file = new File("D:/img/"+fileName);
            httpResponse.writeBody(file);
            try {
                Thread.sleep(6000);
                System.out.println("第"+i+"个图片获取结束");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
